﻿using AutoMapper;
using SIG.Model.Store;
using SIG.Service;
using SIG.ViewModel.Front.Store;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SIG.WebMVC.Controllers
{
    public class GoodsCategoryController : BaseController
    {
        private readonly IGoodsCategoryService _goodsCategoryService;
        //private readonly IGoodsService _goodsService;
        //private readonly IPageMetaService _pageMetaService;
        private IMapper _mapper;
        public GoodsCategoryController(IGoodsCategoryService goodsCategoryService,IMapper mapper)
        {
          //  _goodsService = goodsService;
            _goodsCategoryService = goodsCategoryService;
         //   _pageMetaService = pageMetaService;
            _mapper = mapper;


        }

        // GET: GoodsCategory
        public ActionResult Index()
        {
            return View();
        }
        public PartialViewResult RecommendCategories()
        {
            var list = _goodsCategoryService.RecommendCategories();
            var categories = _mapper.Map<IEnumerable<GoodsCategory>, IEnumerable<GoodsCategoryVM>>(list);
            return PartialView("_RecommendCategories",categories);
        }
    }
}